package wooqoo.widgetevent;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class TextActivity extends Activity {

	private EditText nomalText;
	private EditText nameText;
	private EditText passText;
	private EditText npassText;
	private EditText mailText;
	private EditText phoneText;
	private EditText addrText;
	private EditText allText;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_text);
		
		nomalText = (EditText) findViewById(R.id.nomalText);
		nameText = (EditText) findViewById(R.id.nameText);
		passText = (EditText) findViewById(R.id.passText);
		npassText = (EditText) findViewById(R.id.npassText);
		mailText = (EditText) findViewById(R.id.mailText);
		phoneText = (EditText) findViewById(R.id.phoneText);
		addrText = (EditText) findViewById(R.id.addrText);
		allText = (EditText) findViewById(R.id.allText);
	}

	public void showInput(View v) {
		StringBuilder sb = new StringBuilder();
		
		sb.append("일반문자 : ").append(nomalText.getText()).append("\n");
		sb.append("이름 : ").append(nameText.getText()).append("\n");
		sb.append("비밀번호 : ").append(passText.getText()).append("\n");
		sb.append("숫자비밀번호 : ").append(npassText.getText()).append("\n");
		sb.append("이메일 : ").append(mailText.getText()).append("\n");
		sb.append("전화번호 : ").append(phoneText.getText()).append("\n");
		sb.append("주소 : ").append(addrText.getText()).append("\n");
		sb.append("여러줄문자 : ").append(allText.getText());
		
		Toast.makeText(getApplicationContext(), sb.toString(), Toast.LENGTH_LONG).show();
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.text, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
